(function(){
    var divs = nav_2.children;
    var bs = nav_2.getElementsByTagName("b");
    var is = nav_2.getElementsByTagName("i");
    // var art = main.getElementsByTagName("article");
    var as =nav_2.getElementsByTagName("a");
    var as1 =nav_1.getElementsByTagName("a");
    a1()
    console.log(bs)
    console.log(is)
    console.log(as)
    console.log(as1)
    console.log(as1)
    console.log(divs)
    function a1() {
        for (var i = 1; i < divs.length; i++) {
            divs[i].onclick = function () {
                for (var i = 0; i < bs.length; i++) {
                    divs[i + 1].lastElementChild.className = ""
                    bs[i].className = "";
                    is[i].className = "iconfont ";
                }
                var as = this.lastElementChild.children;
                this.firstElementChild.firstElementChild.nextElementSibling.className = "active";  // b标签 文本标题
                this.firstElementChild.firstElementChild.className = "iconfont active";  // 字体图标
                as1[1].innerText=this.firstElementChild.firstElementChild.nextElementSibling.innerText;
                this.lastElementChild.className = "active";  //span + -
                if (this.lastElementChild.className == "active") {
                    for (var i = 1; i < divs.length; i++) {
                        divs[i].firstElementChild.lastElementChild.innerText = "+";
                    }
                    this.firstElementChild.lastElementChild.innerText = "-";
                }
            }
        }
        for (var i = 0; i < as.length; i++) {
            as[i].onclick = function () {
                for (var i = 0; i < as.length; i++) {
                    as[i].className = "";
                    art[i].style.display="none";
                    as[i].setAttribute("xb", i);
                }
                as1[2].innerText=this.innerText;
                this.className = "active";
                i=this.getAttribute("xb");
                art[i].style.display="block";
            }
        }
    }
})();
